import { Http } from '@/common/api'

// 列表
export const listUrl = '/upms/datasource/page'
/**
 * 新增
 * @param params
 * @return {*|Promise}
 */
export const apiPostAddDatasource = async (params) => Http.post('/upms/datasource/add', params)
/**
 * 编辑
 * @param params
 * @return {*|Promise}
 */
export const apiPutEditDatasource = async (params) => Http.put('/upms/datasource/update', params)

/**
 * 删除
 * @param params
 * @return {*|Promise}
 */
export const apiPutDeleteDatasource = async (dsId) => Http.delete(`/upms/datasource/delete?dsId=${dsId}`)
/**
 * 启用
 * @param params
 * @return {*|Promise}
 */
export const apiPutEnableDatasource = async (dsId) => Http.put(`/upms/datasource/enable?dsId=${dsId}`)

/**
 * 停用
 * @param params
 * @return {*|Promise}
 */
export const apiPutDisableDatasource = async (dsId) => Http.put(`upms/datasource/disable?dsId=${dsId}`)

export const apiPutResetPwd = async (params) => Http.post('upms/datasource/changePwd', params)
